<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #chart {
            width: 500px;
            height: 400px;
            outline: 1px solid red;
        }
    </style>
</head>
<body>
    <div id="chart"></div>
    <script src="./echarts.min.js"></script>
    <script>


        const data = [
            {
                sex: '男',
                value: 150,
            },
            {
                sex: '女',
                value: 160,
            },
        ];

        // 初始化图表容器
        const chartDOM = document.querySelector('#chart');
        const chart = echarts.init(chartDOM);

        // 配置项
        const config = {
            series: [
                {
                    name: 'xxxxxxx',
                    type: 'pie',
                    roseType: 'radius',
                    radius: '100%',
                    data: data.map(function (item) {
                        return {
                            name: item.sex,
                            value: item.value,
                        };
                    }),
                },
            ],
        };

        // smooth 平滑过渡

        // 导入配置项
        chart.setOption(config);
    </script>
</body>
</html>